import java.util.Scanner;

public class step2_1 {
        int[] score =new int[10];
        String[] name =new String[10];
        int []mscore=new int[2];
        String []mname=new String[2];
        public void add(int i) {
                Scanner sn = new Scanner(System.in);
                System.out.print("请输入一个学生姓名:");
                        name[i]= sn.next();
                Scanner sc = new Scanner(System.in);
                System.out.print(name[i] + "的学生成绩为:");
                score[i] = sc.nextInt();
                if (i==0)
                {
                    mscore[0]=score[0];
                    mscore[1]=score[0];
                }
                if (score[i]>mscore[0])
                {
                    mscore[0]=score[i];
                    mname[0]=name[i];
                }
                if (score[i]<mscore[1])
                {
                    mscore[1]=score[i];
                    mname[1]=name[i];
                }
                System.out.println(name[i]+",分数:"+score[i]+"已经录入完毕");
        }
        public void Sprint(int i){
            System.out.println(name[i]);
            System.out.println(score[i]);
        }
        public void mmprint(){
            System.out.println("the max name is "+mname[0]+" and this score is "+mscore[0]);
            System.out.println("the min name is "+mname[1]+" and this score is "+mscore[1]);
        }
    public static void main(String[] args) {
            step2_1 a = new step2_1();
            int num,i;
            Scanner nn =new Scanner(System.in);
            System.out.print("请输入你想添加的人数:");
            num=nn.nextInt();
            for (i=0;i<num;i++)
            {
                a.add(i);
            }
            a.mmprint();
            System.out.println("please input name :");
            Scanner n=new Scanner(System.in);
            String name=n.next();
            for (i = 0; i<num; i++)
            {
                if (name.equals(a.name[i]))
                {
                    a.Sprint(i);
                    break;
                } }
            if(i==num)
            System.out.println("not find!");
    }}